

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import leetcode.IDebug;

public class Solution implements IDebug {

	public List<String> removeDuplicate(List<String> list) {
		Set<String> set = new HashSet<>();
		for (String str : list) {
			set.add(str);
		}
		return new ArrayList<>(set);
	}
	
	public List<String> removeDuplicate1(List<String> list) {
		return list.stream().distinct().collect(Collectors.toList());
	}

	@Override
	public void debug4() {
		List<String> list = new ArrayList<>();
		list.add("hello");
		list.add("hello");
		list.add("world");
		list.add("ketty");
		list.add("ketty");
		List<String> ans = this.removeDuplicate(list);
		for (String str : ans) {
			System.out.println(str);
		}

	}

	@Override
	public void debug3() {
		List<String> list = new ArrayList<>();
		list.add("hello");
		list.add("hello");
		list.add("world");
		list.add("ketty");
		list.add("ketty");
		List<String> ans = this.removeDuplicate1(list);
		for (String str : ans) {
			System.out.println(str);
		}

	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug1() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		Solution so = new Solution();
		so.debug1();
		so.debug2();
		so.debug3();
		so.debug4();
		
	}

}
